package com.microservice.order.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * 订单控制器
 */
@Slf4j
@RestController
@RequestMapping("/order")
public class OrderController {
    
    /**
     * 健康检查
     */
    @GetMapping("/health")
    public String health() {
        return "Order Service is running";
    }
    
    /**
     * 创建订单
     */
    @PostMapping("/create")
    public String createOrder(@RequestParam Long userId, @RequestParam String productName) {
        log.info("创建订单: userId={}, productName={}", userId, productName);
        // TODO: 实现创建订单逻辑
        return "Order created successfully";
    }
    
    /**
     * 查询订单
     */
    @GetMapping("/{id}")
    public String getOrderById(@PathVariable Long id) {
        log.info("查询订单: {}", id);
        // TODO: 实现查询订单逻辑
        return "Order info for id: " + id;
    }
}
